import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_uikit/widget/text/text_widget.dart';
import 'package:get/get.dart';

import '../../common/app_text_style.dart';
import 'general_dialog_logic.dart';

class GeneralDialogPage extends StatefulWidget {
  const GeneralDialogPage({Key? key}) : super(key: key);

  @override
  State<GeneralDialogPage> createState() => GeneralDialogPageState();
}

class GeneralDialogPageState extends State<GeneralDialogPage> {
  final logic = Get.put(GeneralDialogLogic());
  final state = Get.find<GeneralDialogLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(state.title ?? ""),
      ),
      body: Align(
        alignment: Alignment.center,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                GestureDetector(
                  onTap: (){
                    logic.showGeneralDialog();
                  },
                  child:Container(
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(16.w)),
                        color: const Color(0xFFFFF5F6)),
                    width: 200.w,
                    height: 48.w,
                    child:
                    TextWidget("通用对话框", TS_FF1D2129_16_W5, textAlign: TextAlign.center),
                  ) ,
                )
                ,
                SizedBox(height: 50.w),

                GestureDetector(
                  onTap: (){
                    logic.showInputDialog();
                  },
                  child: Container(
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(16.w)),
                        color: const Color(0xFFFFF5F6)),
                    width: 200.w,
                    height: 48.w,
                    child:
                    TextWidget("文本输入对话框", TS_FF1D2129_16_W5, textAlign: TextAlign.center),
                  ) ,
                )

              ]),
          )
    );
  }
}
